<template>
  <div>
    <vm-common-header
      :pageTitle="pageTitle"
      :goBack="goBack"></vm-common-header>

    <!-- 公用三级页面组件 -->
    <vm-common-level-item
      :vmCommonLevelItem="vmCommonLevelItem"></vm-common-level-item>
  </div>
</template>

<script>
  import vmCommonHeader from '@/components/vm-common-header' // header 组件
  import vmCommonLevelItem from '@/components/work_bench/vm-common-level-item'

  export default {
    data() {
      return {
        pageTitle: this.$route.query.pageTitle,
        pageType: this.$route.query.pageType,
        goBack: this.$route.meta.goBack,
        vmCommonLevelItem: new Array()
      }
    },
    created() {
      this.getCartgoryData();
    },
    methods: {
      getCartgoryData() {
        const pageType = this.pageType;
        switch ( pageType ) {
          /* 采购询源工具与方案 start */
          case 'bid':
            this.vmCommonLevelItem = {
              title: '招投标',
              lineC: '#fca197',
              code: 'ZTB_01',
              parentCode: 'CGFS_01',
              data: [
                {dTitle: '信息汇总', iconClass: 'Summary', childCode: 'ZTBXXHZ_01', router: '/work_bench/invitebids/information_aggregation'},
                {dTitle: '状态管理', iconClass: 'statusHandle', childCode: 'ZTBZTGL_01', router: '/work_bench/invitebids/status_list'},
                {dTitle: '审核公告', iconClass: 'examineNotice', childCode: 'FBGG_01', router: '/work_bench/invitebids/notice_list'},
                {dTitle: '资格预审', iconClass: 'prequalification', childCode: 'ZGYS_01', router: '/work_bench/invitebids/inquiry_list'},
                {dTitle: '发布标书', iconClass: 'publication', childCode: 'FBBS_01', router: '/work_bench/invitebids/sendbids_list'},
                {dTitle: '投标管理', iconClass: 'bidding', childCode: 'ZGSC_01', router: '/work_bench/invitebids/bidManage_list'},
                {dTitle: '评标设置', iconClass: 'bidSetting', childCode: 'PBGLLB_01', router: '/work_bench/invitebids/evalubid_list'},
                {dTitle: '中标查看', iconClass: 'Winbid', childCode: 'ZBSZ_01', router: '/work_bench/invitebids/bidview_list'},
                {dTitle: '中标公示', iconClass: 'bidPublicity', childCode: 'ZBGSGL_01', router: '/work_bench/invitebids/bidpublicity_list'},
                {dTitle: '招标完成', iconClass: 'Completion', childCode: 'ZBJSLB_01', router: '/work_bench/invitebids/bidend_list'}
              ]
            };
            break;
          case 'cpc':
            this.vmCommonLevelItem = {
              title: '竞比价列表',
              lineC: '#fca197',
              code: 'JJGL_01',
              parentCode: 'CGFS_01',
              data: [
                {dTitle: '审核公告', iconClass: 'examineNotice', childCode: 'JJFBGG_01', router: '/work_bench/bidding/cpc_notice_list'},
                {dTitle: '预审资格', iconClass: 'prequalification', childCode: 'JJZGYS_01', router: '/work_bench/bidding/cpc_inquiry_list'},
                {dTitle: '结果公示', iconClass: 'resultNotice', childCode: 'ZBGS_01', router: '/work_bench/bidding/cpc_zbgslist'},
              ]
            };
            break;
          case 'enquiry_view':
            this.vmCommonLevelItem = {
              title: '询价',
              lineC: '#fca197',
              code: 'XBJCG_01',
              parentCode: 'CGFS_01',
              data: [
                {dTitle: '询价列表', iconClass: 'inquiryList', childCode: 'XBJLB_01', router: '/work_bench/consultprice/enquiry_list'},
                {dTitle: '中标公示', iconClass: 'bidPublicity', childCode: 'XBJZBGS_01', router: '/work_bench/consultprice/enquiry_successful_publicity'},
              ]
            };
            break;
          case 'singleSource_view':
            this.vmCommonLevelItem = {
              title: '单一来源',
              lineC: '#fca197',
              code: 'DYLYCG_01',
              parentCode: 'CGFS_01',
              data: [
                {dTitle: '公告列表', iconClass: 'noticeList', childCode: 'DYLYGGLB_01', router: '/work_bench/single/singleSource_list'},
                {dTitle: '中标公示', iconClass: 'bidPublicity', childCode: 'DYLYGS_01', router: '/work_bench/single/singleSource_successful_publicity'},
              ]
            };
            break;
          case 'competitiveNegotiation_view':
            this.vmCommonLevelItem = {
              title: '竞争性谈判',
              lineC: '#fca197',
              code: 'JZXTP_01',
              parentCode: 'CGFS_01',
              data: [
                {dTitle: '谈判列表', iconClass: 'negotiationList', childCode: 'JZXTPLB_01', router: '/work_bench/negotiate/competitiveNegotiation_list'},
                {dTitle: '中标公示', iconClass: 'bidPublicity', childCode: 'JZXTPGS_01', router: '/work_bench/negotiate/competitiveNegotiation_successful_publicity'},
              ]
            };
            break;
          /* 采购询源工具与方案 end */
          /* 供应链管理 start */
          case 'purchasingView':
            this.vmCommonLevelItem = {
              title: '采购管理',
              lineC: '#f1d348',
              code: 'CGGL_01',
              parentCode: 'GYL_01',
              data: [
                {dTitle: '到货单', iconClass: 'billGoods', childCode: 'DHDGL_01', router: '/supplyChain/advice_arrival_bill'},
                {dTitle: '待检单', iconClass: 'checkList', childCode: 'DJDGL_01', router: '/supplyChain/InsPending_bill'},
                {dTitle: '质检单', iconClass: 'qualityCheckList', childCode: 'ZJDGL_01', router: '/supplyChain/quality_testing_bill'},
                {dTitle: '退货单', iconClass: 'returnBill', childCode: 'THDGL_01', router: '/supplyChain/sales_return_bill'},
              ]
            };
            break;
          case 'warehouseView':
            this.vmCommonLevelItem = {
              title: '库存管理',
              lineC: '#f1d348',
              code: 'KCGL_01',
              parentCode: 'GYL_01',
              data: [
                {dTitle: '入库管理', iconClass: 'warehousingHandle', childCode: 'RKGL_01', router: '/supplyChain/stock_management'},
                {dTitle: '出库管理', iconClass: 'OutHandle', childCode: 'CJGL_01', router: '/supplyChain/warehouse_management'}
              ]
            };
            break;
          case 'stockView':
            this.vmCommonLevelItem = {
              title: '仓库管理',
              lineC: '#f1d348',
              code: 'CKGL_01',
              parentCode: 'GYL_01',
              data: [
                {dTitle: '仓库列表', iconClass: 'warehouseList', childCode: 'CKLB_01', router: '/supplyChain/warehouse_list'},
                {dTitle: '仓库盘点', iconClass: 'warehouseInventory', childCode: 'CKPD_01', router: '/supplyChain/warehouse_inventory'},
                {dTitle: '仓库调拨', iconClass: 'OutHandleAllocation', childCode: 'CKDB_01', router: '/supplyChain/warehouse_allotting'}
              ]
            };
            break;
          /* 供应链管理 end */
        }
      }
    },
    components: {
      'vm-common-header': vmCommonHeader,
      'vm-common-level-item': vmCommonLevelItem
    }
  }
</script>

<style lang="scss" scoped>

</style>
